import javax.naming.CompositeName;
import java.util.Scanner;

public class Main {
    static int N = 1000;
    int[] snumpos = new int[N + 1];//学号所在的位置
    int[] possnum = new int[N + 1];//位置所在的学号

    public static void main(String[] args) {
        new Main().main();
    }

    public void main() {
        int n, m, p, q;
        Scanner sc = new Scanner(System.in);
        n = sc.nextInt();
        m = sc.nextInt();

        //初始化
        for (int i = 1; i <= n; i++) {
            snumpos[i] = i;
            possnum[i] = i;
        }

        //模拟移动过程
        for (int i = 1; i <= m; i++) {
            int pos1, pos2 = 0, snum;//

            p = sc.nextInt();
            q = sc.nextInt();

            if (q != 0) {
                int move = (q > 0) ? 1 : -1;
                int end = (q > 0) ? q : -q;

                pos1 = snumpos[p];//把该学生叫出列放置于临时位置1上

                //只有end为正，即向后方插队时才会进入循环
                for (int j = 1; j <= end; j++) {
                    snum = possnum[pos1 + move];
                    pos2 = snumpos[snum];

                    possnum[pos1] = snum;
                    snumpos[snum] = pos1;

                    pos1 = pos2;
                }

                //这里是向前插队时的逻辑
                possnum[pos2] = p;
                snumpos[p] += q;
            }
        }

        //让空格和数字成对打印，避免空格落空，造成结果不匹配
        System.out.print(possnum[1]);
        for (int i = 2; i <= n; i++) {
            System.out.print(" " + possnum[i]);
        }

        sc.close();
    }
}